home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / sbin_-_Static_Binary_Files / REQUEST-.{1B < prev    next >
Text File  |  1999-09-17  |  1KB  |  40 lines

  1. #! /bin/sh
  2. LOCK=/tmp/request-route
  3. PATH=/usr/sbin:$PATH    # for ppp-2.2*
  4. export PATH
  5.  
  6. # Note: you are _not_ forced to use ppp!
  7. # You can do whatever you want in order to satisfy the kernel route request.
  8. # It might be a good idea to set up the route as the default route, in case
  9. # you are using e.g. slip or plip or any other net driver...
  10.  
  11. #
  12. # This script will be called from kerneld with the requested route as $1
  13. # Create a chat script for your nameserver (as defined in /etc/resolv.conf)
  14. #
  15.  
  16. chatfile=/etc/ppp/chat.$1
  17.  
  18. if [ -f $chatfile ]
  19. then
  20.     #
  21.     # Tune your favourite parameters to pppd, including the idle-disconnect option.
  22.     # Kerneld will be automatically triggered to load slhc.o and ppp.o
  23.     #
  24.     pppd connect "chat -f $chatfile" /dev/modem 38400 \
  25.          idle-disconnect 600 modem defaultroute noipdefault \
  26.          &  # let pppd detach itself whenever it wants to...
  27.  
  28.     #
  29.     # Timer to be killed by ip-up, tunable! Check kerneld delay as well
  30.     #
  31.     sleep 60 &
  32.     sleepid=$!
  33.     echo $sleepid > $LOCK
  34.     wait $sleepid
  35.     rm -f $LOCK
  36.     exit 0
  37. else
  38.     exit 1
  39. fi
  40.